package com.ctsi.ssdc.admin.repository;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import com.ctsi.ssdc.admin.domain.CscpUser;
import com.ctsi.ssdc.admin.domain.CscpUserExample;
import com.ctsi.ssdc.database.annotation.InjectByDataBaseType;
import com.ctsi.ssdc.database.enums.EnumDatabaseName;

/**
 * @author MyBatis Generator
*/
@InjectByDataBaseType(includes= {EnumDatabaseName.ORACLE})
public interface CscpUserRepository {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @SelectProvider(type=CscpUserSqlProvider.class, method="countByExample")
    long countByExample(CscpUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @DeleteProvider(type=CscpUserSqlProvider.class, method="deleteByExample")
    int deleteByExample(CscpUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @Delete({
        "delete from cscp_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @Insert({
        "insert into cscp_user (username, password)",
        "values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insert(CscpUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @InsertProvider(type=CscpUserSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insertSelective(CscpUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @SelectProvider(type=CscpUserSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpUser> selectByExample(CscpUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @Select({
        "select",
        "id, username, password",
        "from cscp_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR)
    })
    CscpUser selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @UpdateProvider(type=CscpUserSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CscpUser record, @Param("example") CscpUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @UpdateProvider(type=CscpUserSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CscpUser record, @Param("example") CscpUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @UpdateProvider(type=CscpUserSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CscpUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @Update({
        "update cscp_user",
        "set username = #{username,jdbcType=VARCHAR},",
        "password = #{password,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CscpUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user
     *
     * @mbg.generated Mon Apr 23 08:56:34 CST 2018
     */
    @SelectProvider(type=CscpUserSqlProvider.class, method="selectByExampleWithPage")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpUser> selectByExamplewithPage(CscpUserExample example);
}